<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__ADMIN__/css/pintuer.css">
<link rel="stylesheet" href="__ADMIN__/css/admin.css">
<script src="__ADMIN__/js/jquery.js"></script>
<script src="__ADMIN__/js/pintuer.js"></script>
</head>
<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 管理员列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>

    <div class="padding border-bottom">
      <form method="post" action="{:url('admin/staff/lst')}">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:url('admin/staff/add')}"> 添加管理员</a> </li>
        <li>搜索：</li>
          <li>
              <input type="text" placeholder="按管理员姓名搜索" name="name" class="input" style="width:250px; line-height:17px;display:inline-block" />
              <button stype="submit" class="button border-main icon-search">搜索</button>
          </li>
      </ul>
      </form>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>图片</th>

        <th>性别</th>
        <th>联系方式</th>
        <th>邮箱</th>
        <th>状态</th>
        <th>摘要</th>
        <th width="90">创建时间</th>
        <th style="width:280px;">操作</th>
      </tr>
      {volist name="data" id="da"}
         <tr>
          <td>{$da.id}</td>
          <td>{$da.name}</td>
          <td width="10%"><img src="/{$da.sm_pic}" alt="" style="width:80px;height:60px;border-radius:4px;"/></td>

          <td>{$da.sex}</td>
          <td>{$da.phone}</td>
           <td>{$da.email}</td>
             {switch name="da.status"}
             {case value="应用"}<td>{$da.status}</td>{/case}
             {case value="禁用"}<td style="color:red;">{$da.status}</td>{/case}
             {/switch}
           <td title="{$da.staff_desc}">{$da.staff_desc|mb_substr=0,4}</td>
          <td>{$da.create_time}</td>
          <td><div class="button-group">
              <a class="button border-main" href="{:url('admin/staff/showEditPass',['id'=>$da.id])}"><span class="icon-edit"></span>修改密码</a>

              <a class="button border-main" href="{:url('admin/staff/edi',['id'=>$da.id] )}"><span class="icon-edit"></span> 修改</a>
            <a class="button border-red" href="javascript:void(0)" onclick="return del({$da.id})"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
      {/volist}
      <tr>
        <td colspan="12">
          {$page}
        </td>
      </tr>
    </table>
  </div>

<script type="text/javascript">
//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
        $.ajax({
            type : "GET",
            url : "{:url('admin/staff/del')}",
            data : "id="+id,
            dataType :'json',
            success:function (data) {
                if(data == true){
                    alert('亲,您已删除成功!');
                    location.reload(true);
                }else{
                    alert('删除失败,发生了什么^O^');
                }
            },
            error:function (data) {
            },
        })
	}
}
</script>
</body>
</html>